Skip to content

make vlan check conditional on management network for xen #11193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

DaanHoogland
Copy link
Contributor

Description

This PR...

Fixes: #10272

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • build/CI
  • test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@DaanHoogland
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

Copy link

codecov bot commented Jul 14, 2025

Codecov Report

Attention: Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.

Project coverage is 16.58%. Comparing base (61e74e0) to head (7c1bbfb).
Report is 162 commits behind head on main.

Files with missing lines Patch % Lines
...rce/wrapper/xenbase/CitrixSetupCommandWrapper.java 0.00% 6 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #11193      +/-   ##
============================================
+ Coverage     16.15%   16.58%   +0.42%     
- Complexity    13273    13992     +719     
============================================
  Files          5656     5745      +89     
  Lines        497728   510757   +13029     
  Branches      60360    62144    +1784     
============================================
+ Hits          80420    84688    +4268     
- Misses       408357   416599    +8242     
- Partials       8951     9470     +519     
Flag Coverage Δ
uitests 3.91% <ø> (-0.09%) ⬇️
unittests 17.47% <0.00%> (+0.46%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 14173

@DaanHoogland
Copy link
Contributor Author

@blueorangutan test ol9 xcpng83

@blueorangutan
Copy link

@DaanHoogland a [SL] Trillian-Jenkins test job (ol9 mgmt + xcpng83) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian test result (tid-13775)
Environment: xcpng83 (x2), Advanced Networking with Mgmt server ol9
Total time taken: 68299 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr11193-t13775-xcpng83.zip
Smoke tests completed. 141 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_01_prepare_and_cancel_maintenance Error 0.17 test_ms_maintenance_and_safe_shutdown.py

@DaanHoogland
Copy link
Contributor Author

@UAnton can you test if this satisfies your use-case, please?

@UAnton
Copy link

UAnton commented Jul 16, 2025

@UAnton can you test if this satisfies your use-case, please?

I can't. Too much time has passed

@DaanHoogland
Copy link
Contributor Author

@UAnton can you test if this satisfies your use-case, please?

I can't. Too much time has passed

ok, should we close the issue than?

@sureshanaparti sureshanaparti requested a review from Copilot July 23, 2025 17:48
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR modifies the VLAN validation logic for XenServer management networks to only apply the check for XenServer API versions prior to version 8. The change makes the VLAN configuration check conditional based on the XenServer API version, allowing management networks on VLANs for newer XenServer versions while maintaining the restriction for older versions.

  • Adds API version check to conditionally enforce VLAN restrictions on management networks

@@ -104,14 +104,14 @@ public Answer execute(final SetupCommand command, final CitrixResourceBase citri
for (final PIF pif : hostPifs) {
final PIF.Record rec = pif.getRecord(conn);
if (rec.management) {
if (rec.VLAN != null && rec.VLAN != -1) {
if (host.getAPIVersionMajor(conn) < 8 && rec.VLAN != null && rec.VLAN != -1) {
Copy link
Preview

Copilot AI Jul 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The API version check should include proper null safety. Consider checking if host.getAPIVersionMajor(conn) returns a valid value before comparison to prevent potential NullPointerException.

Suggested change
if (host.getAPIVersionMajor(conn) < 8 && rec.VLAN != null && rec.VLAN != -1) {
Integer apiVersionMajor = host.getAPIVersionMajor(conn);
if (apiVersionMajor == null) {
final String msg = "Unable to determine API version for host: " + citrixResourceBase.getHost().getUuid();
logger.warn(msg);
return new SetupAnswer(command, msg);
}
if (apiVersionMajor < 8 && rec.VLAN != null && rec.VLAN != -1) {

Copilot uses AI. Check for mistakes.

@DaanHoogland
Copy link
Contributor Author

@sureshanaparti , if there is no ask for this, I am not sure if we should put effort in it. I am not full of confidence on this implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

XCP-ng Management network on VLAN
3 participants